<template>
  <div>
    <n-modal v-model:show="props.modelValue">
      <n-card style="width: 50vw" title="会员中心" closable @close="clickPop" :bordered="false" size="huge" role="dialog"
        aria-modal="true">
        <div class="payCenter">
          <div class="pay-bg">
            <div class="pay-serect">
              <div class="select-bg">
                VIP
              </div>
            </div>
          </div>

          <div class="introduce">
            <div class="illustrate">VIP尊享不限量极速下载、视频倍速、超大空间、在线解压8G、批量转存数50000个等50+特权。</div>
            <div class="illustrate-item">
              <div :class="[selectIndex == index ? 'illustrate-select' : 'illustrate-selectTwo']"
                v-for="(item, index) in price" :key="index" @click="selectItem(index)">
                <div class="Limited-time">限时特惠</div>
                <div class="illustrate-name">{{ item.name }}</div>
                <div class="illustrate-price">￥<span>{{ item.money }}</span></div>
                <div class="original-price">￥{{ item.money + 50 }}</div>
                <div class="bottom-pricw">立省￥{{ item.illustrate }}</div>
              </div>
            </div>

            <div class="hint">到期以￥263自动续费12个月，可随时取消</div>

            <div class="Scan-code">
              <div class="Scan-title">扫码支付</div>
              <div class="Scan-man">此处放二维码</div>
              <div class="Scan-money">
                实付<span class="actual">￥245</span>
                已优惠<span class="discount">￥53</span>
              </div>
            </div>
          </div>
        </div>
      </n-card>
    </n-modal>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
const props = defineProps(['modelValue'])

const emit = defineEmits(['update:modelValue'])

const showModal = ref(false)

const price = ref([
  {
    name: '连续包年',
    money: 234,
    illustrate: 34,
  },
  {
    name: '连续包年',
    money: 234,
    illustrate: 34,
  },
  {
    name: '连续包年',
    money: 234,
    illustrate: 34,
  },

])

const selectIndex = ref(0)

const selectItem = (index) => {
  selectIndex.value = index
}

const clickPop = () => {
  emit('update:modelValue', false)
}
</script>

<style lang="scss" scoped>
.payCenter {
  box-sizing: border-box;
  // border: 1px solid red;

  .pay-bg {
    // margin-top: 10px;
    width: 100%;
    height: 8vh;
    background: url('../../assets/image/user_card_bg.png');
    background-size: 100% 100%;
    display: flex;
    align-items: end;


    .pay-serect {
      // border: 1px solid red;
      height: 5vh;
      // border:1px solid red;

      .select-bg {
        // border: 1px solid red;
        width: 10vw;
        height: 5vh;
        background: url('../../assets/image/double_middle_red.png');
        background-size: 100% 100%;
        color: #6B2D00;
        font-size: 22px;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }
  }

  .introduce {
    background-color: white;
    padding: 1px;
    width: 100%;
    // border: 1px solid red;


    .illustrate {
      font-size: 14px;
      color: #cc782b;
      // border: 1px solid red;
      // text-align: left;
      margin-left: 10px;
      margin-top: 5px;
    }

    .illustrate-item {
      // border: 1px solid red;
      margin-top: 10px;
      height: 20vh;
      padding: 5px;
      display: flex;
      // justify-content: center;
      // justify-content: space-around;

      .illustrate-select {
        cursor: pointer;
        border: 2px solid #FF6F0B;
        background: linear-gradient(101.37deg, #fff9c6 1.05%, #ffe1c2 97.37%);
        width: 9vw;
        height: 100%;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        margin-right: 20px;
        // align-items: center;
        // overflow: hidden;
        box-shadow: 0px 0px 8px 8px rgba(0, 0, 0, .05);
        position: relative;

        .Limited-time {
          width: 82px;
          height: 32px;
          // border: 1px solid red;
          position: absolute;
          left: -0.4vw;
          top: -2vh;
          background: url('../../assets/image/market_bg.png');
          background-size: 100% 100%;
          font-size: 12px;
          text-align: center;
          line-height: 32px;
        }

        .illustrate-name {
          color: #cc782b;
          font-size: 18px;
          font-weight: bold;
          margin-top: 10px;
          // border: 1px solid red;

        }

        .illustrate-price {
          color: #f60;
          font-size: 24px;
          margin-left: -10px;
          // border: 1px solid red;

          span {
            font-size: 34px;
            font-weight: bold;
          }
        }

        .original-price {
          color: gray;
          font-size: 14px;
          position: relative;
          margin-top: -10px;
        }

        .original-price:after {
          content: "";
          position: absolute;
          width: 45px;
          height: 1px;
          background-color: gray;
          // border: 1px solid red;
          top: 50%;
          left: 0;
        }

        .bottom-pricw {
          height: 3vh;
          background: linear-gradient(270deg, #f60, #ffa047);
          color: white;
          text-align: center;
          line-height: 3vh;
          width: 100%;
          border-radius: 5px;
        }
      }


      .illustrate-selectTwo {
        cursor: pointer;
        border: 2px solid transparent;
        background-color: #f7f9fc;
        width: 9vw;
        height: 100%;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;

        justify-content: space-between;
        margin-right: 20px;
        // overflow: hidden;
        box-shadow: 0px 0px 10px 10px rgba(0, 0, 0, .08);
        position: relative;

        .Limited-time {
          width: 82px;
          height: 32px;
          // border: 1px solid red;
          position: absolute;
          left: -0.4vw;
          top: -2vh;
          background: url('../../assets/image/market_bg.png');
          background-size: 100% 100%;
          font-size: 12px;
          text-align: center;
          line-height: 32px;
          color: black;

        }


        .illustrate-name {
          color: black;
          font-size: 18px;
          margin-top: 10px;
        }

        .illustrate-price {
          color: #f60;
          font-size: 24px;
          margin-left: -10px;

          span {
            font-size: 34px;
            font-weight: bold;
          }
        }

        .original-price {
          color: gray;
          font-size: 14px;
          position: relative;
          margin-top: -10px;
          // margin-bottom: -20px;
        }

        .original-price:after {
          content: "";
          position: absolute;
          width: 45px;
          height: 1px;
          background-color: gray;
          // border: 1px solid red;
          top: 50%;
          left: 0;
        }

        .bottom-pricw {
          width: 100%;
          height: 3vh;
          // background: linear-gradient(270deg, #f60, #ffa047);
          background-color: #FFF6E8;
          color: rgba(107, 45, 0, .6);
          text-align: center;
          line-height: 3vh;
          border-radius: 5px;
        }
      }
    }

    .hint {
      color: #a2abbd;
      font-size: 12px;
      margin-top: 5px;
      margin-left: 10px;
    }

    .Scan-code {
      height: 15vh;
      // border: 1px solid red;
      display: flex;
      padding: 10px;

      .Scan-title {
        color: black;
        font-size: 14px;
      }

      .Scan-man {
        width: 8vw;
        height: 15vh;
        margin-left: 10px;
        border: 1px solid #cc782b;
        color: black;
      }

      .Scan-money {
        margin-left: 10px;
        // border: 1px solid red;
        color: black;
        line-height: 15vh;
        font-size: 14px;

        .actual {
          color: #f60;
          font-weight: bold;
          // color: ;
          font-size: 22px;
        }

        .discount {
          color: #f60;
        }
      }
    }
  }
}


.dark .introduce {
  background-color: #2C2C32;
}

.dark .payCenter .introduce .illustrate {
  color: white;
}

.dark .payCenter .introduce .illustrate-item .illustrate-selectTwo .illustrate-name {
  color: white;
}

.dark .payCenter .introduce .illustrate-item .illustrate-selectTwo .illustrate-price {
  color: white;
}

.dark .payCenter .introduce .illustrate-item .illustrate-selectTwo .original-price {
  color: white;
}

.dark .payCenter .introduce .illustrate-item .illustrate-selectTwo .original-price:after {
  background-color: white;
}

.dark .payCenter .introduce .illustrate-item .illustrate-selectTwo {
  background-color: gray;
  border: 2px solid white;
}

.dark .payCenter .introduce .Scan-code .Scan-title {
  color: white;
}

.dark .payCenter .introduce .Scan-code .Scan-money {
  color: white;
}

:deep() {

  // card组件的padding
  .n-card__content {
    padding: 0;
  }

  .n-card-header {
    padding: 7px;

    // background-color: #101014;
    .n-card-header__main {
      text-align: center;
    }
  }

  .n-menu-item-content-header {
    text-align: left !important;
  }

  .n-layout-content.n-layout.n-layout--static-positioned {
    padding: 1px !important;
  }

  // .n-menu .n-menu-item-content {
  //   padding: 0;
  // }

  .n-menu .n-menu-item-content .n-menu-item-content-header {
    // .my-classSon {
    //   display: flex;
    //   align-items: center;
    //   box-sizing: border-box;

    // border: 1px solid red;
    // .my-titleSon {
    //   font-size: 14px;
    //   width: 130px;
    //   border: 1px solid red;
    //   overflow: hidden;
    // }

    //   .includeDivSon {
    //     // border: 1px solid red;
    //     width: 15px;
    //     height: 35px;
    //     margin-left: 8px;
    //     display: flex;
    //     flex-direction: column;
    // }
  }

  // .n-layout-sider {
  //   background-color: transparent;
  // }
}
</style>